package cn.kgm.product;

import cn.kgm.product.entity.BrandEntity;
import cn.kgm.product.service.BrandService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class ProductTestService {

    @Autowired
    private BrandService brandService;

    @Test
    public void contextLoad(){
//        BrandEntity brandEntity = new BrandEntity();
//        brandEntity.setDescript("brand");
//        brandEntity.setFirstLetter("d");
//        brandEntity.setName("brand");
//        brandEntity.setLogo("brand");
//        brandService.save(brandEntity);
        List<BrandEntity> brands = brandService.list(new QueryWrapper<BrandEntity>().eq("brand_id", 1L));
        brands.forEach(item->{
            System.out.println(item);
        });

    }
}
